package cn.tj.wenda.cloud.exception;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;


/**
 * 封装的业务异常类
 * @author Wenda
 * @date 2018年8月8日
 */
public class BusinessException extends RuntimeException {

	private static final long serialVersionUID = 1L;
	private String messageId;
	private List<String> args = new ArrayList<>();
	private String errMsg;
	
	public BusinessException(String mesId, String... args) {
		super();
		//this.errMsg = DicMessage.getInstance().getMessage(mesId, args);
		this.messageId = mesId;
		this.args.addAll(Arrays.asList(args));
	}

	public BusinessException(String message) {
		super();
		this.errMsg = message;
	}

	public String getMessageId() {
		return messageId;
	}

	public void setMessageId(String messageId) {
		this.messageId = messageId;
	}

	public List<String> getArgs() {
		return args;
	}

	public void setArgs(List<String> args) {
		this.args = args;
	}

	public String getErrMsg() {
		return errMsg;
	}

	public void setErrMsg(String errMsg) {
		this.errMsg = errMsg;
	}
}
